package com.csy.user.controller.system;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.csy.commons.core.controller.BaseController;
import com.csy.commons.core.domain.BaseResponse;
import com.csy.user.entity.system.domain.dto.SysAreaDto;
import com.csy.user.entity.system.service.SysAreaService;

/**
 * 地区区域控制类
 */
@RestController
@RequestMapping("/system/area")
public class SysAreaController extends BaseController {

    @Resource
    private SysAreaService sysAreaService;

    /**
     * 获取地区树形结构
     * @return
     */
    @RequestMapping("/tree")
    public BaseResponse<List<SysAreaDto>> getAreaTree(){
        return BaseResponse.success(sysAreaService.findAreaAsTree());
    }

}
